package com.springboot.alibaba.dubbo.provider.service.impl;


import com.springboot.alibaba.dubbo.service.TestService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Service;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author lin
 * @create 2018-07-30 16:40
 **/
//,mock = "com.study.dubbo.service.service.mock.TestServiceImplMock"
// -Ddubbo.protocol.port=20882
@Service(timeout = 6000)
@Slf4j
public class TestServiceImpl implements TestService {

    @Override
    public String test() {
        log.info("被调用+"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
            return "provider test";
        }
        throw new RuntimeException("测试");
    }
}
